


using Mengsk.ProxyDelivery.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mengsk.ProxyDelivery.Service
{
    public class SellerChargeService : ServiceBase<SellerCharge>
    {
        const string APIURL_INSERT = "/webservice/sellercharge/chargeforseller.html";

        public DataCollection<SellerCharge> GetByAll(SellerChargePayType payType, int sellerId, string comment, DateTime startCreateTime, DateTime endCreateTime, int pageIndex, int pageSize)
        {
            Request req = new Request { Api = "getByAll" };
            req.Add("payType", payType);
            req.Add("sellerId", sellerId);
            req.Add("comment", comment);
            req.Add("startCreateTime", this.FormatToDBTime(startCreateTime));
            req.Add("endCreateTime", this.FormatToDBTime(endCreateTime));
            req.Add("pageIndex", pageIndex);
            req.Add("pageSize", pageSize);
            return this.DoRemoteCall<SellerCharge>(req).ToDataCollection();
        }

        public void Chargeforseller(int sellerId, float money, string comment, string password)
        {
            IDictionary<string, string> para = new Dictionary<string, string>();

            para["sellerId"] = sellerId.ToString();
            para["comment"] = comment;
            para["money"] = money.ToString("F2");
            para["password"] = password;
            this.DoPost<int>(APIURL_INSERT, para);
        }
    }
}
